<template>
<div class="hello">
    <el-input v-model="input" placeholder="请输入你要查询的学号" />
    <div class="hello1">
    <p>"             "</p><el-button @click="search" type="primary"  size = "large" >查询</el-button>
</div>
</div>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="date" label="日期" width="180" />
    <el-table-column prop="name" label="学号" width="180" />
    <el-table-column prop="address" label="姓名" />
    <el-table-column prop="result" label="结果" />
  </el-table>
</template>


<script>
import { getCurrentInstance, reactive,ref} from "vue";
export default{
     setup(){
        const {proxy} = getCurrentInstance()
        const input = ref('')
        const tableData = reactive([
        ])
        const search = async()=>{
           const obj2 = {sno:input.value}
           const obj = {sno:input.value}
           const res1 = await new proxy.$request(proxy.$urls.m().stu,obj2).modepost()
           console.log(res1)
           const res = await new proxy.$request(proxy.$urls.m().find,obj).modepost()
           if (res1.data.sno == "软件202") {
               for (var k in res.data.list){
                   tableData.push({date:res.data.list[k].date1,name:res.data.list[k].sno,address:res1.data.cname,result:res.data.list[k].resqu})
               }
           }
        }

                
    return {tableData,input,search}
    }


}
</script>
<style>
.hello{
    width:400px; 
    /* padding-top: 30px; */
    height: 40px;
     display: flex;
}
.hello1{
    /* width:400px; */
    /* margin: 0 auto; */
    padding-top: 0px;
    height: 40px;
    display: flex;
    align-items: center;
}
</style>
